/*
  Copyright (C) 2013 Napspirit / Thierry Rochelet

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.
  
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
  
  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/


package com.napspirit.tmx.ui;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;

import java.net.URL;

import com.napspirit.tmx.NapTMX;

public class ReportDialog extends JDialog {
    
   
    public ReportDialog(String text) {
        this.initUI(text);
    }

    public final void initUI(String text) {

        this.setLayout(new BorderLayout());

        JLabel name = new JLabel(text);
        name.setFont(new Font("Serif", Font.PLAIN, 8));

        JScrollPane scrollPane = new JScrollPane(name);
        this.add(scrollPane, BorderLayout.CENTER);

        JButton close = new JButton("Close");
        close.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent event) { dispose(); }
            });
        this.add(scrollPane, BorderLayout.NORTH);

        this.setModalityType(ModalityType.APPLICATION_MODAL);

        this.setTitle("Report "+NapTMX.APPLICATION_NAME);
        this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
        this.setLocationRelativeTo(null);
        this.setSize(500, 500);
    }
}
